package com.org.cloud.lg.model;
import com.org.cloud.lg.api.MBaseService;
import com.org.cloud.lg.utils.BaseContextKit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

public class BaseController<Service extends MBaseService>{

	@Autowired
    protected Service service;


	@RequestMapping("delByPk")
    protected boolean delete(@RequestParam String pk){
        return service.deleteByPk(pk);
    }

    @RequestMapping("getByPk")
    protected Object getByPk(@RequestParam String pk){
        return service.getByPk(pk);
    }

    protected  String getUserId(){
	    return BaseContextKit.getUserID();
    }
}